﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cherry.Agile.Logging
{
    /// <summary>
    /// 提供对Iloger的默认实现基类
    /// </summary>
    public abstract class Logger:ILogger
    {
        /// <summary>
        /// 
        /// </summary>
        protected string Category { get; set; }

        /// <summary>
        /// 构造一个Logger
        /// </summary>
        /// <param name="category">日志分类名称</param>
        public Logger(string category) { this.Category = category; }

        #region ILogger Members
        /// <summary>
        /// Debug 
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void Debug(string message);

        /// <summary>
        /// 写入提示信息
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void Info(string message);

        /// <summary>
        /// 写入异常信息
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void Error(string message);

        /// <summary>
        /// 写入异常信息
        /// </summary>
        /// <param name="message">内容</param>
        /// <param name="ex">异常</param>
        public abstract void Error(string message, System.Exception ex);

        /// <summary>
        /// 写入告警信息
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void Warn(string message);

        /// <summary>
        /// 写入致命错误信息
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void Fatal(string message);

        #endregion

        /// <summary>
        /// 性能告警
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void PerforemanceWarn(string message);


        /// <summary>
        /// Sql跟踪日志
        /// </summary>
        /// <param name="message">内容</param>
        public abstract void SqlTrace(string message);
    }
}
